import Vue from 'vue'
import Router from 'vue-router'

// 导入组件
import Index from './components/index.vue'

// librarian
import Login from './components/librarian/Login.vue'
import Home from './components/librarian/Home.vue'
import Register from './components/librarian/Register.vue'
import All from './components/librarian/book/All.vue'
import History from './components/librarian/notice/History.vue'
import Reader_Manage from './components/librarian/reader/Manage.vue'
import Affair_Return from './components/librarian/affair/Return.vue'
import Detail from './components/librarian/book/Detail.vue'
import Welcome from './components/librarian/Welcome.vue'

// reader
import Reader_Login from './components/reader/Reader_Login.vue'
import Reader_Search from './components/reader/Search_Result.vue'

// admin
import Admin_Login from './components/admin/Admin_Login.vue'
import Password_Recover from './components/admin/Password_Recover.vue'
import Admin_Home from './components/admin/Admin_Home.vue'
import Admin_ChangePwd from './components/admin/Admin_ChangePwd.vue'




Vue.use(Router)
const router = new Router({
    routes: [
        { path: '/', redirect: '/index' },
        {
            path: '/index',
            component: Index,
            children: [
                { path: '/reader_login', component: Reader_Login },
                { path: '/search_result', component: Reader_Search },
            ]
        },
        { path: '/login', component: Login },
        { path: '/register', component: Register },
        {
            path: '/home',
            component: Home,
            redirect: '/welcome',
            children: [
                { path: '/all_book', component: All },
                { path: '/notice_history', component: History }, // YR FT
                { path: '/reader_manage', component: Reader_Manage }, // ZZ
                { path: '/affair_return', component: Affair_Return }, // YT
                { path: '/detail/:type/:id', component: Detail }, // YT
                { path: '/welcome', component: Welcome },
            ]
        },
        { path: '/admin_login', component: Admin_Login },
        { path: '/password_recover', component: Password_Recover },
        { path: '/admin_home', component: Admin_Home },
        { path: '/admin_changePwd', component: Admin_ChangePwd},

    ]
})



export default router